package com.healthmgmt.app.service.impl;

import java.util.List;

import com.healthmgmt.app.domain.HeightRecord;
import com.healthmgmt.app.mapper.HeightRecordMapper;
import com.healthmgmt.app.service.IHeightRecordService;
import com.healthmgmt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 身高Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-29
 */
@Service
public class HeightRecordServiceImpl implements IHeightRecordService
{
    @Autowired
    private HeightRecordMapper heightRecordMapper;

    /**
     * 查询身高
     * 
     * @param recordId 身高主键
     * @return 身高
     */
    @Override
    public HeightRecord selectHeightRecordByRecordId(Long recordId)
    {
        return heightRecordMapper.selectHeightRecordByRecordId(recordId);
    }

    /**
     * 查询身高列表
     * 
     * @param heightRecord 身高
     * @return 身高
     */
    @Override
    public List<HeightRecord> selectHeightRecordList(HeightRecord heightRecord)
    {
        return heightRecordMapper.selectHeightRecordList(heightRecord);
    }

    /**
     * 新增身高
     * 
     * @param heightRecord 身高
     * @return 结果
     */
    @Override
    public int insertHeightRecord(HeightRecord heightRecord)
    {
        heightRecord.setCreateTime(DateUtils.getNowDate());
        return heightRecordMapper.insertHeightRecord(heightRecord);
    }

    /**
     * 修改身高
     * 
     * @param heightRecord 身高
     * @return 结果
     */
    @Override
    public int updateHeightRecord(HeightRecord heightRecord)
    {
        heightRecord.setUpdateTime(DateUtils.getNowDate());
        return heightRecordMapper.updateHeightRecord(heightRecord);
    }

    /**
     * 批量删除身高
     * 
     * @param recordIds 需要删除的身高主键
     * @return 结果
     */
    @Override
    public int deleteHeightRecordByRecordIds(Long[] recordIds)
    {
        return heightRecordMapper.deleteHeightRecordByRecordIds(recordIds);
    }

    /**
     * 删除身高信息
     * 
     * @param recordId 身高主键
     * @return 结果
     */
    @Override
    public int deleteHeightRecordByRecordId(Long recordId)
    {
        return heightRecordMapper.deleteHeightRecordByRecordId(recordId);
    }
}
